@echo off
if exist "%BUILD_SRC%local_set.bat"	call "%BUILD_SRC%local_set.bat"
if not defined P4_PATH ( 
	for /f "usebackq delims=*"  %%a in (`where /F p4`) do set P4_PATH=%%~a
	if not defined P4_PATH ( 
		echo P4_PATH is not defined 
		exit /B 1
	)
)

"%P4_PATH%" login -s > nul
if %errorlevel% NEQ 0 (
	echo Please login p4
	"%P4_PATH%" login
)
if %errorlevel% NEQ 0 exit /B 1

"%P4_PATH%" sync %2/%3/...#head

